import { Redirect } from 'react-router-dom'
import Register from '../pages/register'
import Login from '../pages/login';
import Newhome from '../pages/Newhome'
import Main from '../pages/Newhome/main';
import Aesthetic from '../pages/Newhome/aesthetic';
import Pubblog from '../pages/Newhome/pubblog';
import Aboutme from '../pages/Newhome/aboutme';
import Mood from '../pages/Newhome/mood'
import Allaesthetic from '../pages/Newhome/aesthetic/aesatheticleft';
import Aesathedetail from '../pages/Newhome/aesthetic/aesathedetail';
import Adminpage from '../pages/adminpage';
import Useradmin from '../pages/adminpage/useradmin';
import Blogadmin from '../pages/adminpage/blogadmin';
import Blogtypeadmin from '../pages/adminpage/blogtypeadmin'
import Rightadmin from '../pages/adminpage/rightadmin'

const router = [
    {
        path: "/",
        exact: true,
        render: () => (<Redirect to="/login"></Redirect>),
    },
    {
        path: "/adminpage",
        component: Adminpage,
        routes: [
            {
                path: "/adminpage",
                exact: true,
                render: () => (<Redirect to="/adminpage/useradminpage"></Redirect>)
            }, {
                path: "/adminpage/useradminpage",
                component: Useradmin,
            }, {
                path: "/adminpage/blogadminpage",
                component: Blogadmin
            }, {
                path: "/adminpage/blogtypeadmin",
                component: Blogtypeadmin
            }, {
                path: "/adminpage/rightadmin",
                component: Rightadmin
            }
        ]
    },
    {
        path: "/register",
        component: Register
    },
    {
        path: "/login",
        component: Login
    },
    {
        path: "/home",
        component: Newhome
        , routes: [{
            path: "/home",
            exact: true,
            render: () => (<Redirect to="/home/homepage"></Redirect>)
        },
        {
            path: "/home/homepage",
            component: Main
        }, {
            path: "/home/publog",
            component: Pubblog
        }, {
            path: "/home/aboutme",
            component: Aboutme
        }, {
            path: "/home/mood",
            component: Mood
        }, {
            path: "/home/aesthetic",
            component: Aesthetic,
            routes: [{
                path: "/home/aesthetic",
                exact: true,
                render: () => (<Redirect to="/home/aesthetic/allaesthetic"></Redirect>)
            }, {
                path: "/home/aesthetic/allaesthetic",
                component: Allaesthetic
            }, {
                path: "/home/aesthetic/aesathedetail/:id",
                component: Aesathedetail
            }]
        }]
    },
]

export default router;